using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FiltronASP.Modules.Abstracts;
using FiltronASP.Models.DAO.Interfaces;
using System.Web.UI.WebControls;
using FiltronASP.Models;
using FiltronASP.Models.DAO.Filtron;
using FiltronASP.Helpers.CatalogueMenu;
using FiltronASP.Helpers.Translations;

namespace FiltronASP.Modules
{
    public class replacementsCarsSearchModule : AbstractModule
    {
        private Page currentPage;

        /// <summary>
        /// Klasa odpowiedzialna za generowanie contentu przez modul.
        /// </summary>
        /// <param name="page">biezaca strona</param>
        /// <returns>content</returns>
        public override string GenerateContent(FiltronASP.Models.Page page)
        {
            this.currentPage = page;
            string htmlToReturn = "";
            int pageId = page.page_id;
            int languageId = Convert.ToInt32(page.language_id);
            htmlToReturn += this.generateVehiclesMenu(languageId, pageId);

            return htmlToReturn;
        }

        private string generateVehiclesMenu(int languageId, int pageId)
        {
            string htmlToReturn = "";
            htmlToReturn += "<div class='no-padding col-lg-9 col-md-8 col-sm-12 col-xs-12'>";
            htmlToReturn += "<div class='col-md-6 col-sm-6  col-xs-12 kat-sub-select mar-top-20'>";
            htmlToReturn += "<div class='col-xs-12 padding-0' id='replacementsFilterTextInput'>";
            htmlToReturn += String.Format("<input placeholder='{0}' type='text' class='input-crosslist crosslist-placeholder' id='query' name='filter_number'> <button onclick=\"replacementFNHandler('query', '" + Helpers.XmlHelper.XMLHelper.getLanguageNameById(Convert.ToInt32(this.currentPage.language_id)) + "','" + VirtualPathUtility.ToAbsolute("~/Content/img/ajax-loader.gif") + "')\" type='button' id='querySearchBtn' class='search-crosslist'>&gt;</button>", translationHelper.getTranslation("_repFilterNumber", languageId));
            htmlToReturn += "</div>";
            htmlToReturn += "</div>";
            htmlToReturn += "<div class='col-md-6 col-sm-6 col-xs-12 kat-sub-select mar-top-20'>";
            htmlToReturn += "<div class='  col-xs-12 padding-0' id='multiSearchReplacementsFilterTextInput'>";
            htmlToReturn += String.Format("<input placeholder='{0}' type='text' class='input-crosslist crosslist-placeholder' id='multisearch_filter_numbers_query' name='filter_number'>  <button onclick=\"replacementFNMultisearchHandler('multisearch_filter_numbers_query', '" + Helpers.XmlHelper.XMLHelper.getLanguageNameById(Convert.ToInt32(this.currentPage.language_id)) + "','" + VirtualPathUtility.ToAbsolute("~/Content/img/ajax-loader.gif") + "')\" type='button' id='multisearchBtn' class='search-crosslist'>&gt;</button>", translationHelper.getTranslation("_repMultisearchFilterNumber", languageId));
            htmlToReturn += String.Format("<p id='search-info-multi'>{0}</p>", translationHelper.getTranslation("_repMultisearchFilterNumberInfo", languageId));
            htmlToReturn += "</div>";
            htmlToReturn += "</div>";
            htmlToReturn += "</div>";
            return htmlToReturn;
        }

    }
}
